//////////////////////////////////////////////////////////////////////////////////////////////////////////// // // //---------------------------- Ebrahim Foulaadvand, 30 July 2013 ----------------- // // // // The routine "JacobiNeumann" solves the 2D Laplace equation using Jacobi relaxation method. // // Neumann boundary condition is used. The region is a rectangle of sides lengths Lx and Ly. // // // // // // // // //////////////////////////////////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include using namespace std; main() { const Nxsize=100,Nysize=200; int i,j,n,Nx=100,Ny=200,T=7000; double Lx=1,Ly=2,a1=0.,a2=0.,a3=0.1,a4=0.,delx,dely; double Phi[Nxsize+1][Nysize+1],Phinew[Nxsize+1][Nysize+1]; // 2D arrays "Phi" and "Phinew" store the current and updated values of potential at grid points. ofstream file1 ("Y profile x=0.5Lx n=10.plt"); // output file for the potential profile at timestep n=10. ofstream file2 ("Y profile x=0.5Lx n=50.plt"); // output file for the potential profile at timestep n=50. ofstream file3 ("Y profile x=0.5Lx n=300.plt"); // output file for the potential profile at timestep n=50. ofstream file4 ("Y profile x=0.5Lx n=500.plt"); // output file for the potential profile at timestep n=50. delx=Lx/Nx; cout<<"delx= "<